<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>NeverGetMe</title>
    <link rel="shortcut" th:href="@{/icon/java.svg}"/>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
          integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
    <script src="https://code.jquery.com/jquery-3.4.1.min.js"
            integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
            crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
            integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
            crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
            integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
            crossorigin="anonymous"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link th:href="@{/css/viewer.min.css}" rel="stylesheet">
    <script th:src="@{/js/viewer.min.js}"></script>
</head>
<body>
<!--style="background-color: #343a40"-->
<div th:replace="header::html"></div>

<div class="container" id="MainBodyShow" style="margin-top: 10px">
    <div class="container">
        <div class="container" id="articleTables">
        </div>
    </div>
</div>
<nav aria-label="Page navigation example">
    <ul class="pagination justify-content-center" id="pageInfoNav">
    </ul>
</nav>
<div th:replace="footer::html"></div>
<script th:src="@{/myjs/articleList.js}"></script>
<script th:src="@{/myjs/addsvg.js}"></script>
<script th:src="@{/myjs/websocket.js}"></script>

<script>

    var currentPage = 1;

    //updateArticle(pageInfos);
    function readCurrentPage(newPage) {
        $.post("/article/getArticleList",
            {
                pageNum: newPage,
                pageSize: 10
            },
            function (data, status) {
                if (data && status == 'success') {
                    updateArticle(data);
                    updateArticleList(data.list);
                    updateFooter(data.size);
                    $(function () {
                        $("#MainBodyShow img").click(function () {
                            showImage($(this)[0].src)
                        });
                    });
                }
                console.log(status);
            });
        currentPage = newPage;
    }

    $(document).ready(function () {
        readCurrentPage(1);
        let websocket=initWebSocket();
        // sendMessage("1");
    });




</script>
<script th:src="@{/myjs/header.js}"></script>
<script>
    readUserInfo();
</script>
</body>
</html>